<?php
declare (strict_types=1);

namespace app\exam\logic;

use app\common\exception\LogicException;
use app\exam\model\ModuleConfig as ModuleConfigModel;

/**
 * 考试版块配置逻辑类
 */
class ModuleConfig extends ModuleConfigModel
{

	public function getValueInfo($module_id = 0)
	{
		$data  = $this->findOrEmpty($module_id);
		if ( $data->isEmpty() ) throw new LogicException("配置信息错误");
		
		return $data->value;
	}

	public function getQuestionCount($module_id = 0)
	{
		$value = $this->getValueInfo($module_id);
		return $value['question_count'];
	}
}